<%@page import="board.BoardVo"%>
<%@page import="board.Board"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>

<script>
function fileDel(fileDelFlag, serial){
	location.href = "index2.jsp?inc_center=./board/modify.jsp&fileDelFlag=" + fileDelFlag + "&serial=" + serial;
}
function btn_modify(serial){
	board_frm.action = "index2.jsp?inc_center=./board/modify_result.jsp&serial=" + serial;
	board_frm.submit();
}

</script>
</head>
<body>
<jsp:useBean id="boardVo" class="board.BoardVo"/>
<jsp:setProperty property="*" name="boardVo"/>

<%
Board bb = new Board();
bb.setVo(boardVo);
BoardVo vo = bb.view();
%>

<center><h1>수정 화면</h1></center><br/>

시리얼 : <%=vo.getSerial()%><br/>
<br/>
<div id='modify_body'>
	<form name="board_frm" method="post" action="" enctype="multipart/form-data">
		아이디     : <input type="text" name="mid" value="<%=vo.getMid()%>"><br/>
		암&emsp;호 : <input type="password" name="pwd" value="<%=vo.getPwd()%>"><br/>
		제&emsp;목 : <input type="text" name="subject" value="<%=vo.getSubject()%>"><br/>
		내&emsp;용 : <textarea rows="5" cols="30" name="content"><%=vo.getContent()%></textarea><br/>
		파&emsp;일 : 
		<%
		if(vo.getFilename() == null || boardVo.getFileDelFlag().equals("del")) {
		%>
		<input type="file" name="newfilename">
		<%} else { %>
		<%=vo.getFilename()%>
		<input type="button" value="삭제" onclick="fileDel('del',<%=vo.getSerial()%>)">
		<%} %>
		
		<br/>
		<br/>
		<br/><br/><hr/><br/>
		<input type="button" value="수정" onclick="btn_modify(<%=vo.getSerial()%>)">
		<input type="button" value="목록" onclick="btn_list()">
		
		<input type="hidden" name="filename" value="<%=vo.getFilename()%>">
		<input type="hidden" name="serial" value="<%=vo.getSerial()%>">
		<input type="hidden" name="fileDelFlag" value="<%=boardVo.getFileDelFlag()%>">
	</form>
</div>

</body>
</html>